//
//  DKWebVC.h
//  Whistle
//
//  Created by ZhangAo on 15/9/30.
//  Copyright © 2015年 BookSir. All rights reserved.
//

#import "DKBaseVC.h"
#import <WebKit/WebKit.h>

@protocol DKWebVCDelegate <NSObject>

@optional

- (void)loadDidFinish:(WKWebView *)webView;

@end

@interface DKWebVC : DKBaseVC

@property (nonatomic, copy) NSString *URLString;
@property (nonatomic, strong) NSURL *URL;
@property (nonatomic, strong) NSURLRequest *URLRequest;

@property (nonatomic, assign) BOOL isShowToolBar; // 默认 NO
@property (nonatomic, copy) NSArray<UIBarButtonItem *> *toolbarItems;

@property (nonatomic, readonly) WKWebView *webView;
@property (nonatomic, readonly) WKWebViewConfiguration *webViewConfiguration;
@property (nonatomic, weak) id<DKWebVCDelegate> delegate;

- (void)callJSFunction:(NSString *)functionName param:(NSString *)params;

- (void)runJS:(NSString *)js completeBlock:(void (^)(NSString *result))completeBlock;

- (void)webViewDidLoad;

- (BOOL)webViewShouldDecidePolicyForNavigationAction:(WKNavigationAction *)navigationAction;

- (void)reload;

- (void)updateTitle:(NSString *)title;

@end
